import "../index";
import config from "@/config/index.js";
import request from "../index.js";

//小狐狸签名登录
export const metamasklogin = (data) => {
  return request.post(`${config.baseUrl}/v1/user/metamasklogin`, {
    data: data,
  });
};

//获取登录随机串

export const getcode = (address) => {
  return request.post(`${config.baseUrl}/v1/user/getcode?${address}`);
};

// 获取签名随机数
export const getRandomNum = (data) => {
  return request.get(`${config.baseUrl}/webapi/getRandomNum`, {
    data: data,
  });
};

//首页
export const getHomeDataApi = () => {
  return request.post(`${config.baseUrl}/v1/index/data`);
};
export const notice = () => {
  return request.post(`${config.baseUrl}/v1/index/notice`);
};
//HolidCoin
export const getHoldDataApi = () => {
  return request.post(`${config.baseUrl}/v1/cusdt/data`);
};
//HolidCoin 快照记录
export const getHoldSnapshotApi = () => {
  return request.post(`${config.baseUrl}/v1/cusdt/snapshot`);
};

//HolidCoin 奖励记录
export const getHoldRewardtApi = () => {
  return request.post(`${config.baseUrl}/v1/cusdt/reward`);
};

//Team
export const getTeamDatatApi = () => {
  return request.post(`${config.baseUrl}/v1/team/data`);
};

//Team
export const getTeamDirectApi = (data) => {
  return request.post(`${config.baseUrl}/v1/team/direct`, {
    data: data,
  });
};

//stake
export const getStakeDatatApi = () => {
  return request.post(`${config.baseUrl}/v1/stake/data`);
};
//stake
export const getStakIndexApi = () => {
  return request.post(`${config.baseUrl}/v1/stake/index`);
};

//质押
export const getStakeinApi = (data) => {
  return request.post(`${config.baseUrl}/v1/stake/stakein`, {
    data: data,
  });
};

//资产记录
export const getCoinlogApi = (data) => {
  return request.post(`${config.baseUrl}/v1/asset/coinlog`, {
    data: data,
  });
};

export const getBalanceApi = () => {
  return request.post(`${config.baseUrl}/v1/asset/balance`);
};
export const getReleasesApi = () => {
  return request.post(`${config.baseUrl}/v1/stake/releases`);
};

export const getTeamSetApi = (data) => {
  return request.post(`${config.baseUrl}/v1/team/set`, {
    data: data,
  });
};

export const getWithdrawApi = (data) => {
  return request.post(`${config.baseUrl}/v1/asset/withdraw`, {
    data: data,
  });
};

export const getExchangedataApi = () => {
  return request.post(`${config.baseUrl}/v1/asset/exchangedata`);
};

export const getExchangeApi = (data) => {
  return request.post(
    `${config.baseUrl}/v1/asset/exchange
`,
    {
      data: data,
    }
  );
};

export const getblockvest = () => {
  return request.post(`${config.baseUrl}/v1/index/blockvest`);
};

export const invest = (data) => {
  return request.post(`${config.baseUrl}/v1/index/invest`, {
    data: data,
  });
};

export const getswapData = () => {
  return request.post(`${config.baseUrl}/v1/user/swapData`);
};
export const swap = (data) => {
  return request.post(`${config.baseUrl}/v1/user/swap`, {
    data: data,
  });
};

export const drawdData = () => {
  return request.post(`${config.baseUrl}/v1/user/drawdData`);
};
export const draw = (data) => {
  return request.post(`${config.baseUrl}/v1/user/draw`, {
    data: data,
  });
};

export const orderDetail = (data) => {
  return request.post(`${config.baseUrl}/v1/user/orderDetail`, {
    data: data,
  });
};
export const orders = () => {
  return request.post(`${config.baseUrl}/v1/user/orders`);
};

export const home = () => {
  return request.post(`${config.baseUrl}/v1/user/home`);
};

export const coinlog = (data) => {
  return request.post(`${config.baseUrl}/v1/user/coinlog`, {
    data: data,
  });
};

export const noticeread = (data) => {
  return request.post(`${config.baseUrl}/v1/index/noticeread`, {
    data: data,
  });
};

export const follow = () => {
  return request.post(`${config.baseUrl}/v1/index/follow`);
};

//FlexiVest下单
export const investflexiApi = (data) => {
  return request.post(`${config.baseUrl}/v1/index/investflexi`, {
    data: data,
  });
};

//兑换数据
export const swapDataApi = () => {
  return request.post(`${config.baseUrl}/v1/user/swapData`);
};

export const withdrawlogApi = () => {
  return request.post(`${config.baseUrl}/v1/asset/withdrawlog`);
};

export const depositlogApi = () => {
  return request.post(`${config.baseUrl}/v1/asset/depositlog`);
};
